package com.jzj.jzjctripapi.task;


import com.jzj.jzjctripapi.service.impl.PersoninfoServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;



@Component
@Slf4j
public class DataSender {
    @Autowired
    private PersoninfoServiceImpl personinfoService;

    @Scheduled(cron = "0 50 22 * * ?") // 每天晚上22：50执行
    //@Scheduled(cron = "0 * * * * ?")//每分钟执行一次
    public void sendDataPeriodically() {
        log.info("【定时任务启动】");
        personinfoService.sendDataToThirdParty();
        log.info("【定时任务执行结束】");
    }

}
